package com.ecoolex.discount.sales.core.manager;

import com.ecoolex.discount.sales.core.dao.YWStoreCateDAO;
import com.ecoolex.discount.sales.entity.YWBrandCate;
import com.ecoolex.discount.sales.entity.YWBrandCateExample;
import com.ecoolex.discount.sales.entity.YWStoreCate;
import com.ecoolex.discount.sales.entity.YWStoreCateExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YWStoreCateManager {
    @Autowired
    private YWStoreCateDAO dao;

    public List<YWStoreCate> getCateByStoreId(String storeId){
        YWStoreCateExample.Criteria criteria = YWStoreCateExample.newAndCreateCriteria()
                .andStoreIdEqualTo(storeId)
                .andStatusEqualTo(1)
                .andDeletedEqualTo(YWStoreCate.NOT_DELETED);
        return dao.selectByExample(criteria.example());
    }
}
